<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/common/common.jsp" %>
<html>
<head>
    <meta charset="utf-8"/>
    <title>厅干部平时考核管理系统</title>
    <script type="text/javascript" src="<c:url value='/resource/jxkh/js/views/dailyedit.js'/>"></script>
    <script>
        function submitForm() {
            $("#index1").val(index1);
            $("#index2").val(index2);
            $("#index3").val(index3);
            //top.mask();
            $("#submit_form").ajaxSubmit({
                type: "post",
                dataType: "json",
                success: function (data) {
                    if (data.data.status == 1) {
                        showMessage("操作成功！");
                        window.setTimeout(function () {
                            parent. search0bj();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);

                            //  $('#ifrm_data', parent.document).attr("src", url);
                        }, 1000);
                    } else {
                        showMessage(data.data.body);
                    }
                },
                error: function () {
                    showMessage("失败！");
                }
            });
        }
        function initTable() {
            if ("${dbid}" == "-1") {
                $("#content11").val("${content1}".replace(/####/g, "\n\r"));
                $("#content21").val("${content2}".replace(/####/g, "\n\r"));
                $("#content31").val("${content3}".replace(/####/g, "\n\r"));
            } else {
                var url = '/jxkh/worklog/weekWorkInfo/@.json'.replace("@","${dbid}")+"?type="+"${type}";
                console.log(url);
                $.ajax({
                    url: url,
                    type: 'get',
                    dataType: "json",
                    async: false,
                    success: function (data) {
                        if (data.hasList) {
                            if (data.list != undefined && data.list != null && data.list != "") {
                                $.each(data.list, function (i, item) {
                                    if (item.type == "1") {
                                        addWork(1, item.workitem, '', 1);
                                    } else if (item.type == "2") {
                                        addWork(2, item.workitem, '', 1);
                                    } else if (item.type == "3") {
                                        addWork(3, item.workitem, '', 1);
                                    }
                                });
                                addWork(3, '', '31', 2);
                                addWork(2, '', '21', 2);
                                addWork(1, '', '11', 2);
                            }
                        }
                    }
                });
            }
        }
    </script>
</head>
<body>
<div class="njga" style="overflow: auto;background: #fff;">
    <!--日历弹出框-->
    <div class="date_pop" id="date_pop" style="display: block;">
        <form action="<c:url value='/worklog/saveWorklog.json'/>" method="post" id="submit_form">
            <input type="hidden" name="workdate" id="workdate" value="${workdate}"/>
            <input type="hidden" name="dbid" id="dbid" value="${dbid}"/>
            <input type="hidden" name="index1" id="index1"/>
            <input type="hidden" name="index2" id="index2"/>
            <input type="hidden" name="index3" id="index3"/>
            <input type="hidden" name="type" id="type" value="${type }"/>
            <%--<input type="hidden" name = "content1" value="${content1}"/>
            <input type="hidden" name = "content2" value="${content2}"/>
            <input type="hidden" name = "content3" value="${content3}"/>--%>
            <div class="row_pop_row" id="workContent11">
                <div class="pop_lf">日常工作</div>
                <div class="pop_rt">
                    <div class="pop_rt_main pop_rt_main1">
                        <textarea rows="2" id="content11" name="content11"></textarea>
                    </div>
                </div>
                <div class="rili_add" id="icon11"></div>
            </div>
            <div class="row_pop_row" id="workContent21">
                <div class="pop_lf">重点工作</div>
                <div class="pop_rt">
                    <div class="pop_rt_main pop_rt_main1">
                        <textarea rows="2" id="content21" name="content21"></textarea>
                    </div>
                </div>
                <div class="rili_add" id="icon21"></div>
            </div>
            <div class="row_pop_row" id="workContent31">
                <div class="pop_lf">交办工作</div>
                <div class="pop_rt">
                    <div class="pop_rt_main pop_rt_main1">
                        <textarea rows="2" id="content31" name="content31"></textarea>
                    </div>
                </div>
                <div class="rili_add" id="icon31"></div>
            </div>
        </form>
    </div>
    <!--日历弹出框结束-->
</div>

</body>

</html>